/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import modelo.Escuela;


public class testDAO {

    
    public static void main(String[] args) {
        
        //Scanner fileIn = new Scanner ( new FileReader("") );
        
        
        try {
            DAOEscuela myDAOEscuela = new DAOEscuela();
            ArrayList<Escuela> e = myDAOEscuela.getEscuelasNac();
            
            
            Scanner cin = new Scanner ( new FileReader ("ordenados_nacional.txt") );
            
            int c = 0;
            while ( cin.hasNext() ){
                System.out.println( e.get(  cin.nextInt()  ).getPromedioGeneral() );
                c++;
            }
            
            System.out.println(c + "Escuelas");
            
            //System.out.println(e.size());
            //System.out.println( e.get(0).getEntidad() + " " + e.get(0).getClaveEscuela() + " " + e.get(0).getNombreEscuela() + " " + e.get(0).getPromedioGeneral()   );
            
            //int a = e.size()-1;
            //System.out.println( e.get(a).getEntidad() + " " + e.get(a).getClaveEscuela() + " " + e.get(a).getNombreEscuela() + " " + e.get(a).getPromedioGeneral()   );
            //System.out.println(e.size());
            //for (int i = 0; i < e.size(); i++ )
            //    System.out.println(e.get(i).getNombreEscuela());
            //myDAOEscuela.getEscuelasNac();
            
        } catch (FileNotFoundException ex) {
            Logger.getLogger(testDAO.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(testDAO.class.getName()).log(Level.SEVERE, null, ex);
        }
        

   }





}
